package com.monster.starter.core.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.ColumnComment;
import lombok.Data;

/**
 * 数据id实体
 * @author kuang
 */
@Data
public class BaseEntityPlusSupper {
    /**
     * 数据id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    @Column(length = 32, isNull = false, isKey = true, comment = "主键id")
    protected String id;
    /**
     * 数据版本
     */
    @Version
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(isNull = false, comment = "数据版本")
    protected Long version;
    /**
     * 数据状态
     * 正常/冻结/删除
     */
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    @Column(isNull = false, comment = "数据状态，0:删除/1：正常")
    protected Integer dataStatus;
}
